package main
import (
	"fmt"
	"encoding/json"
)

type student struct{
	Id int	`json:"id"`
	Name string	`json:"name"`
	Sex byte	`json:"sex"`
	Age int	`json:"age"`
	Chengji []float64	`json:"chengji"`
}

func main(){
	st := student{10001, "ChenRui", 'G', 22, []float64{95.0, 85.0, 98.5, 97.5}}
	fmt.Println("st = ", st)
	buf, err := json.MarshalIndent(st,""," ")
	if err != nil{
		fmt.Println("err = ", err)
	}else{
		fmt.Println("buf = ", string(buf))
	}
}
